/*
 * Hyuga: A Density-Grid Stream Clustering Platform.
 * Copyright (C) 2014 PUC-Rio/Laboratory for Advanced Collaboration
 *
 * Hyuga is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Hyuga is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Hyuga.  If not, see <http://www.gnu.org/licenses/>.
 */
package br.pucrio.inf.lac.konoha.hyuga.events.grid;

import br.pucrio.inf.lac.konoha.hyuga.events.cell.CellClusterEvent;

/**
 * Represent a cell cluster event that has obtained a lock to the cluster list (data stream).
 * 
 * This is useful because the Hyuga engine can now verify if the new dense cell cluster is within the neighborhood of an
 * existing clusters in the cluster list.
 * 
 * @author Marcos Roriz <mroriz@inf.puc-rio.br>
 */
public class LockedCellClusterEvent {

    /** The dense cell cluster event. */
    protected CellClusterEvent cell;
    
    /** Empty Constructor */
    public LockedCellClusterEvent() {}

    /**
     * Clustering Cell that forms the cluster.
     *
     * @param cell the dense cell cluster.
     */
    public LockedCellClusterEvent(CellClusterEvent cell) {
        this.cell = cell;
    }

    //////////////////////////////////////////////////////////////////////////
    // Gets and Sets
    //////////////////////////////////////////////////////////////////////////

    public CellClusterEvent getCell() {
        return cell;
    }

    public void setCell(CellClusterEvent cell) {
        this.cell = cell;
    }
    
    @Override
    public String toString() {
        return "LOCKED WRITE CLUSTER (" + cell.getCore().getX() + ", " + cell.getCore().getY() + ")";
    }
}
